Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop mixing option and non-option parameters #6

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

baierjan
Copy link
Contributor

@baierjan baierjan commented Apr 4, 2024

Assume all options after first non-option arguments are options for the main command. With this, usages like retry zypper -h will interpret options correctly as retry -- zypper -h

Assume all options after first non-option arguments are options for the
main command. With this, usages like `retry zypper -h` will interpret
options correctly as `retry -- zypper -h`
Copy link

@Martchus Martchus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this had some tests but I believe you :-)

Copy link

@kalikiana kalikiana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking up the obscure syntax If the first character of optstring is '+' or the environment variable POSIXLY_CORRECT is set, then option processing stops as soon as a nonoption argument is encountered. I guess it should work. Thanks!

@mergify mergify bot merged commit 2d4e170 into okurz:main Apr 5, 2024
3 checks passed
@baierjan baierjan deleted the getopt branch April 5, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants